package com.fitness.front.service.impl;

import com.anji.captcha.service.CaptchaCacheService;
import com.fitness.front.utils.RedisUtil;
import org.springframework.stereotype.Service;

@Service("fitnessCaptchaCacheService")
public class CaptchaCacheServiceImpl implements CaptchaCacheService{
    @Override
    public void set(String key, String value, long expiresInSeconds) {
        RedisUtil.set(key, value, expiresInSeconds);
    }

    @Override
    public boolean exists(String key) {
        return RedisUtil.hasKey(key);
    }

    @Override
    public void delete(String key) {
        RedisUtil.del(key);
    }

    @Override
    public String get(String key) {
        return RedisUtil.get(key);
    }

    @Override
    public String type() {
        return "redis";
    }
}
